#include "set.h"
using namespace std;

/* 打印set类型的函数模板 */
template<typename T>
void PrintSet(T &s)
{
    for (typename T::iterator iter = s.begin(); iter != s.end(); ++iter)
        cout << *iter << " ";
    cout << endl;
}

void set_test()
{
    //set容器默认从小到大排序
    set<int> s;
    s.insert(10);
    s.insert(20);
    s.insert(30);
 
    //输出set
    cout << " print set content: " << endl;
    PrintSet(s);   //结果为:10 20 30
    cout << endl;
    cout << endl;
}